package in.muton.edushare.poll.panels;

import in.muton.edushare.pages.EduShareBasePage;
import in.muton.edushare.pages.common.EdusharePanel;
import in.muton.edushare.pages.user.UserPage;
import in.muton.edushare.pages.user.UserPolls;
import in.muton.edushare.url.EntityPageParams;

import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.link.Link;
import org.apache.wicket.model.Model;

import com.edushare.common.vo.Users;

public class PollNavigation extends EdusharePanel {

	private static final long serialVersionUID = -7965546611602294571L;

	public PollNavigation(String id, EduShareBasePage page, int entityType,
			int entityId) {
		super(id, page);
		init();
	}

	private void init() {
		Link<Void> l = null;
		add(l = new Link<Void>("userPollPage") {
			private static final long serialVersionUID = -5231069055213749483L;

			@Override
			public void onClick() {
				setResponsePage(UserPolls.class, EntityPageParams
						.getParams(new Model<Users>(getLoggedInUser())));
			}
		});
		l.add(new Label("userPageName", "My Polls"));

		add(new Link<Void>("homePage") {
			private static final long serialVersionUID = -1530267762967403726L;

			@Override
			public void onClick() {
				setResponsePage(UserPage.class, EntityPageParams
						.getParams(new Model<Users>(getLoggedInUser())));
			}
		});
	}

}
